package org.springframework.demo3;

import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * BeanNameAware：是在当前bean初始化的时候回调的，BeanNameAware只属于当前bean对象，不像beanPostProcesson他是全局的bean对象
 */
@Component("aaa")
public class BeanNameAwareImpl implements BeanNameAware {

	//让实现这个接口的bean知道自己在spring容器里的名字
	@Override
	public void setBeanName(String name) {
		System.out.println("beanName....."+name);
	}
}
